package com.class06.service.impl;

import com.class06.service.Calculator;
import org.springframework.stereotype.Component;

/**
 * 实现计算接口,单纯添加 + - * / 实现! 掺杂其他功能!
 */
@Component //标识组件被spring容器管理
public class CalculatorPureImpl implements Calculator {
    @Override
    public int add(int a, int b) {
        int result = a + b;
        return result;
    }

    @Override
    public int sub(int a, int b) {
        //        打印参数
        int result = a - b;
        return result;
    }

    @Override
    public int mul(int a, int b) {
        //        打印参数
        int result = a * b;
        return result;
    }

    @Override
    public int div(int a, int b) {
        //        打印参数
        int result = a / b;
        return result;
    }


}